package com.lc.qianrenshiye.activity;

import android.content.Intent;
import android.os.Bundle;

import com.lc.qianrenshiye.BaseActivity;
import com.lc.qianrenshiye.BaseApplication;
import com.lc.qianrenshiye.R;
import com.lc.qianrenshiye.widget.GuideView;
import com.zcx.helper.bound.BoundView;
import com.zcx.helper.pager.Guide;

/**
 * Created by Administrator on 2016/3/14.
 */
public class GuideActivity extends BaseActivity {

    @BoundView(R.id.guide_guide_view) private GuideView guideView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_guide);

//        GuideView guideView = (GuideView) findViewById(R.id.guide_guide_view);

        guideView.addLayoutId(R.layout.item_guide_one, R.layout.item_guide_two, R.layout.item_guide_three, R.layout.item_guide_four);

        guideView.setOnEndListener(R.id.guide_three_next_tv, new Guide.OnEndListener() {

            @Override
            public void onEnd() {

                BaseApplication.BasePreferences.saveIsGuide(true);

                if (BaseApplication.BasePreferences.readIsLogin()) {

                    startActivity(new Intent(GuideActivity.this, HomeActivity.class));

                } else {

                    startActivity(new Intent(GuideActivity.this, LoginActivity.class));

                }




                finish();

            }

        });

    }

}
